package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import com.zzyl.nursing.vo.NursingLevelVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/member/orders")
public class MemberOrdersController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     *  获取护理项目分页列表
     * @param nursingProject
     * @return
     */
    @GetMapping("/project/page")
    public TableDataInfo<NursingProject> getNursingProjectPage(NursingProject nursingProject) {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    /**
     * 根据id查询护理项目详情
     * @param id
     * @return
     */
    @GetMapping("/project/{id}")
    public R<NursingProject> getNursingProjectById(@PathVariable Long id) {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}
